﻿Public Class Lista_Habitaciones_libres
    Dim rs As ADODB.Recordset
    Dim sql As String
    Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click
        Me.Dispose()
    End Sub

    Private Sub Lista_Habitaciones_libres_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conectar()
        sql = "SELECT     HABITACION.ENUSO_HABI, HABITACION.NUME_HABI, TIPO_HABITACION.TIPO_HABITACION FROM (HABITACION INNER JOIN TIPO_HABITACION ON HABITACION.CODIGO_TIPO = TIPO_HABITACION.CODIGO_TIPO) WHERE (HABITACION.ENUSO_HABI = 'NO')"
        rs = coneccion.Execute(sql)
        While rs.EOF <> True
            If rs.EOF = True Then
                Exit While
            End If
            Tabla_habitacion.Rows.Add(rs.Fields(1).Value, rs.Fields(2).Value)
            rs.MoveNext()
        End While
    End Sub
End Class